<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>叩丁狼骡窝窝后台管理系统</title>
    <#include "../common/header.ftl" >

    <style>
        .modal-body img{
            width: 100%;
        }
    </style>
    <script>
       $(function () {
           //查看文章按钮
           $(".lookBtn").click(function () {
               var id = $(this).data("id");
               //发送ajax请求查询游记内容
               $.get('/travelContent/getContentById',{id:id},function (data) {
                   $(".modal-body").html(data.result.content);
               })

               $("#contentModal").modal('show');
           })

           //取消发布
           $('.changeStateBtn').click(function () {
               var state = $(this).data('state');
               var id = $(this).data('id');
               $.get("/travel/updateState",{id:id,state:state},function (data) {
                   if (data.success){
                       window.location.reload();
                   }
               })
           })
       })
    </script>

</head>
<body>

<div class="container " style="margin-top: 20px">
<#--查看文章内容模态框-->
    <div class="modal fade" id="contentModal" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                    </button>
                    <h4 class="modal-title">文章内容</h4>
                </div>
                <div class="modal-body">
                    xxxxxxxxx
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <#include "../common/top.ftl">
    <div class="row">
        <div class="col-sm-3">
            <#assign menu="releaseList"/>
            <#include "../common/menu.ftl">
        </div>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">待审核游记页面</h1>
                </div>
            </div>

            <div class="row">

                <div >
                    <form class="form-inline" id="searchForm" action="/travel/releaseList" method="post">
                        <input type="hidden" name="currentPage" id="currentPage" value="1">
                    </form>
                    <table class="table table-striped table-hover">
                        <thead>
                        <tr>
                            <th>编号</th>
                            <th>标题</th>
                            <th>封面</th>
                            <th>地点</th>
                            <th>作者</th>
                            <th>发布时间</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <#list result.list as t>
                            <tr>
                                <td>${t_index+1}</td>
                                <td>${t.title}</td>
                                <td><img src="${t.coverurl}" width="70"></td>
                                <td>${t.place.name}</td>
                                <td>${t.author.nickName}</td>
                                <td>${t.releasetime?string('yyyy-MM-dd')}</td>
                                <td>${t.stateName}</td>
                                <td>
                                    <a href="javascript:void(0);" data-state="1"  data-id="${t.id}" class="changeStateBtn btn btn-info btn-xs btn-input" >取消发布</a>
                                </td>
                                <td>
                                    <a href="javascript:void(0);" class="lookBtn btn btn-info btn-xs btn-input" data-id="${t.id}">查看文章</a>
                                </td>
                                <td>
                                    <a href="javascript:void(0);" data-state="-1" data-id="${t.id}" class="changeStateBtn btn btn-info btn-xs btn-input">推荐(暂不写)</a>
                                </td>

                            </tr>
                        </#list>
                        </tbody>
                    </table>
                    <#include "../common/page.ftl" />
                </div>
            </div>

        </div>
    </div>
</div>
</body>
</html>